﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<IList<JSC.Portal.Entities.PortalSite>>" %>
<asp:Content ID="Head1" ContentPlaceHolderID="Head" runat="server">
    <% this.Title = JSC.Portal.Web.App.Resources.Msg.PortalSiteManagement;  %>
    <script type="text/javascript">
        $(function() {
            $("#grid").flexigrid({
                usepager: false, title: "<%= JSC.Portal.Web.App.Resources.Msg.Sections %>", useRp: false
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <table id="grid">
        <thead>
            <tr>
                <th width="230"><%= JSC.Portal.Web.App.Resources.Msg.Action %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.Name %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.Url %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.WebmasterMail %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.DefaultLanguage %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.DefaultTemplate %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.ValidFrom %></th>
                <th width="100"><%= JSC.Portal.Web.App.Resources.Msg.ValidTill %></th>
            </tr>
        </thead>
        <tbody>
            <%foreach (PortalSite ps in ViewData.Model) { %>
            <tr>
                <td>
                    <%= Html.GridLinkButton(JSC.Portal.Web.App.Resources.Msg.Edit, Url.Action("Edit", new { id = ps.Id }))%>
                    <% if (ps.PortalPages.Count > 0) { %>
                    <%= Html.GridLinkButton(JSC.Portal.Web.App.Resources.Msg.Edit + " " + JSC.Portal.Web.App.Resources.Msg.Page, Url.Action("Edit", ControllerNames.PORTALPAGES_CONTROLLER, new { id = ps.PortalPages[0].Id }))%>
                    <% } %>
                    <%= Html.GridLinkButton(JSC.Portal.Web.App.Resources.Msg.CreateRootPage, Url.Action("CreatePage", ControllerNames.PORTALPAGES_CONTROLLER, new { id = ps.Id }))%>
                </td>
                <td>
                    <%= ps.Name %>
                </td>
                <td>
                    <%= ps.Url %>
                </td>
                <td>
                    <%= ps.WebmasterMail %>
                </td>
                <td>
                    <%= ps.DefaultLanguage %>
                </td>
                <td>
                    <%= ps.DefaultTemplate.Name %>
                </td>
                <td>
                    <%= ps.ValidFrom.ToString("dd-MM-yyyy") %>
                </td>
                <td>
                    <%= ps.ValidTill.HasValue ? ps.ValidTill.Value.ToString("dd-MM-yyyy") : JSC.Portal.Web.App.Resources.Msg.Infinity %>
                </td>
            </tr>
            <%}%>
        </tbody>
    </table><br />
    <div class="button-bar-right">
        <%= Html.LinkButtonRight(JSC.Portal.Web.App.Resources.Msg.CreateSite, Url.Action("Create"))%>
    </div>
</asp:Content>
